/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "pin_mux.h"
#include "dmaController1.h"
#include "clockMan1.h"
#include "lpuart1.h"

volatile int exit_code = 0;
/* User includes (#include below this line is not maintained by Processor Expert) */
#include <string.h>
#include <stdint.h>
#include <stdbool.h>

#include "anim.h"
#include "FlexWire.h"
#include "userdefine.h"
#include "TPS929120A.h"
#include "system_info.h"
#include "CRC_LUT.h"
#include "TPS929120_APIs.h"
#include "mcu.h"
#include "pwm_pal1.h"

uint8_t buff[4] = {0x1, 0x2, 0x3, 0x4};
uint16_t pwmbuff[1] = {0xFFF};

extern void Anm_2(void);

extern void MCU_DelayMS(uint16_t u16Time);
extern void enableDiagAllCh(uint16_t dev_addr_x);
extern void test_929120(void);

void diagnose_tps(void)
{
    uint16_t dev_idx;

      enableSLS(1);

      LED_Update_Chip_Status(1);

      // Clear all fault flags
      setClr(1, CLRFAULT);
}

int main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  #ifdef PEX_RTOS_INIT
    PEX_RTOS_INIT();                   /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of Processor Expert internal initialization.                    ***/
    Board_Init();
    MCU_DelayMS(10);
    TPS929XX_Init();

    while (1)
    {
//    	for(uint8_t i=0; i<3; i++)
//    	{
//    		enableDiagAllCh(i);
//    		MCU_DelayMS(20);
//    	}
      // Anm_Run();
      // Anm_2();
      test_929120();
      diagnose_tps();
      MCU_DelayMS(20);
    }
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;) {
    if(exit_code != 0) {
      break;
    }
  }
  return exit_code;
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

/* END main */
/*!
 ** @}
 */
/*
 ** ###################################################################
 **
 **     This file was created by Processor Expert 10.1 [05.21]
 **     for the Freescale S32K series of microcontrollers.
 **
 ** ###################################################################
 */

